package jm.demo.jaxb.permission;

import java.util.List;
import java.util.Map;

import org.springframework.context.ApplicationContext;

public interface ISecurityContextManager {

	/**
	 * SecurityContext definition files in json format
	 * @return
	 */
	String getLocation();

	void setLocation(String location);

	Map<String, SecurityContextType> getContexts();

	void setContexts(Map<String, SecurityContextType> contexts);

	/**
	 * Get 
	 * @param context_type
	 * @return
	 */
	SecurityContextType getSecurityContext(String context_type);

	ApplicationContext getApplicationContext();

	String getSecurityContextTypeInJSON(
			String security_context_name);

	/**
	 * Get roles by <code>role_names</code> from SecurityContext <code>context_type</code>
	 * @param context_type SecurityContextType name to be retrived
	 * @param role_names Roles' name need to be retrived
	 * @return
	 *     If role_name is empty, return all roles in the context type
	 */
	List<Role> getSecurityContextTypeRoles(String context_type,
			String... role_names);

}